package com.example.liuke.guangguang.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;

import com.example.liuke.guangguang.MainActivity;
import com.example.liuke.guangguang.R;
import com.example.liuke.guangguang.base.baseactivity;
import com.example.liuke.guangguang.bean.mseeagebean;

import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

import butterknife.BindView;
import butterknife.OnClick;
import top.wefor.circularanim.CircularAnim;

public class effectsActivity extends baseactivity {

    @BindView(R.id.toolbar)
    Toolbar toolbar;
    @BindView(R.id.ef1)
    Button ef1;
    @BindView(R.id.ef2)
    Button ef2;
    @BindView(R.id.ef4)
    Button ef4;
    @BindView(R.id.ef5)
    Button ef5;
    @BindView(R.id.fab)
    FloatingActionButton fab;
    @BindView(R.id.ef6)
    Button ef6;
    @BindView(R.id.ef7)
    Button ef7;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        });
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_effects;
    }

    @OnClick({R.id.ef1, R.id.ef2, R.id.ef4, R.id.ef5,R.id.ef6,R.id.ef7})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.ef1:
                CircularAnim.hide(ef1).go();
                break;
            case R.id.ef2:
                CircularAnim.show(ef1).go();
                break;
            case R.id.ef4:
                CircularAnim.hide(ef1).triggerView(ef4).go();
                break;
            case R.id.ef5:
                CircularAnim.show(ef1).triggerView(ef5).go();
                break;
            case R.id.ef6:

                break;
            case R.id.ef7:
                CircularAnim.fullActivity(effectsActivity.this, view)
                        .colorOrImageRes(R.color.colorPrimary)
                        .go(new CircularAnim.OnAnimationEndListener() {
                            @Override
                            public void onAnimationEnd() {
                                startActivity(new Intent(effectsActivity.this, MainActivity.class));
                                finish();
                            }
                        });
                break;
        }
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onMoonEvent(mseeagebean mseeagebean) {

    }
}
